package jjn.round1;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Jiang Jining
 * @since 2022-11-18 0:13
 */
public class LeetCode217_ContainsDuplicate {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            if (!set.add(num)) {
                return true;
            }
        }
        return false;
    }
}
